package com.hrhx.duhongming.adapter;

import java.util.Map;

import com.github.abel533.echarts.code.SeriesType;
import com.github.abel533.echarts.data.Data;
import com.github.abel533.echarts.json.GsonOption;
import com.github.abel533.echarts.series.Line;
import com.hrhx.duhongming.bean.EchartsConfig;

public class HighChartsPie3DAdapter {

	public static GsonOption adapter(EchartsConfig echartsConfig, GsonOption gsonOption, Map<String, Object> data) {
		HighChartsPie3DAdapter pieAdapter = new HighChartsPie3DAdapter();
		gsonOption = pieAdapter.seriesAdapter(gsonOption, data);
		return gsonOption;
	}

	public GsonOption seriesAdapter(GsonOption gsonOption, Map<String, Object> orientData) {
		Line line = new Line();
		for (String title : orientData.keySet()) {	
			line.data(new Data().name(title).y(orientData.get(title))).type(SeriesType.pie).name("占比：");				
		}
		gsonOption.series(line);
		return gsonOption;
	}

}
